const path = require('path');
module.exports = {
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'build.js'
    },
    mode:"development",
    module: {
        rules: [
            {
                test:  /\.(jpe?g|png|gif|bmp|ttf|eot|svg|woff|woff2)$/i,
                type: 'asset', // 在Webpack 5+中，使用 asset/resource 类型来处理资源文件
                generator: {
                    // 可选：指定资源文件的输出路径和文件名格式
                    filename: 'assets/[contenthash][ext]',
                },
            }
        ]
    }
}